This page last changed on Oct 24, 2006 by cholmes.

Creating and submitting a 'patch' is one of the foundations of open source development, but making the first one can be intimidating. Many new to open source will have never heard of them. They are how established committers vet new potential contributors, by examining all the code to make sure it is good. If anyone were allowed to submit directly to the repository things would likely break a lot more often, patches are a technical advance that makes it easy to automatically apply contributed code to the existing base.

The easiest way to get set up for making and sending patches is to get SVN working. Then you can just type: svn diff -u -F^f <file to patch> to generate a patch. To output it to a file, go: svn diff -u -F^f <file to patch> > <outfile>. Eclipse also has the ability to create patches (can someone fill this in? I'm not sure exactly how...)

Coding Style

If your code deviates too much from the GeoServer Code Conventions, it is more likely to be rejected. Please read the conventions and follow them.

diff -u

Use diff -u or diff -urN to create patches: when creating your patch, make sure to create it in "unified diff" format, as supplied by the -u argument to diff. Patches should be based in the root source directory, not in any lower subdirectory. Make sure to create patches against a "vanilla", or unmodified source tree.

Describe your changes

Describe the technical detail of the change(s) your patch includes and try to be as specific as possible. Note that we prefer technical reasoning above marketing: give us clear reasons why "this way" is good. Justify your changes and try to carry enough weight. It is important to note the version to which this patch applies.

Separate your changes

Separate each logical change into its own patch. For example, if your changes include both bug fixes and performance enhancements, separate those changes into two or more patches. If your changes include an API update, and a new module which uses that new API, separate those into two patches.

Verifying your patch

To ensure that your patch gets in quickly, please test your code and make sure the code is clean. The new patch should be against trunk, unless it's a fix specifically for a branch.

Submitting your patch:

Patches should be submitted via our issue tracker. Create a bug report or feature request, attach your patch using the file upload form and schedule against the next release to be made on the branch your patch is against.

Applying a patch

This is more a note for committers, but to apply a patch, use the 'patch' unix utility. 'patch -p0 < <file to patch>' is one way to do it. Check the man for more information, there are a lot of little options that can be useful.

Document generated by Confluence on Jan 16, 2008 23:26